-- First, we insert into Father table. Secondly we insert into Child table. -------------- select * from CUSTOMER ; 5 row------------------ /* select 'insert into CUSTOMER values(' ||Lpad(custid , 2,' ')||Q'[,']' ||Rpad(name|Q'[']' , 8,' ')||Q'[,']' ||Rpad(address||Q'[']',18,' ')||Q'[,]' ||Rpad(Q'[']'||nvl(phone,null)||Q'[']',16,' ')||Q'[);]' customer from customer; */ insert into CUSTOMER values( 1,'¹ÚÁö¼º' ,'¿µ±¹ ¸Çü½ºÅ¸' ,'000-5000-0001' ); insert into CUSTOMER values( 2,'±è¿¬¾Æ' ,'´ëÇѹα¹ ¼­¿ï' ,'000-6000-0001' ); insert into CUSTOMER values( 3,'Àå¹Ì¶õ' ,'´ëÇѹα¹ °­¿øµµ' ,'000-7000-0001' ); insert into CUSTOMER values( 4,'Ã߽żö' ,'¹Ì±¹ Ŭ¸®ºí·£µå' ,'000-8000-0001' ); insert into CUSTOMER values( 5,'¹Ú¼¼¸®' ,'´ëÇѹα¹ ´ëÀü' ,'' ); commit; --------------- select * from BOOK ; 10 row------------------------------- /* select Q'[insert into BOOK values(]' ||Lpad(bookid , 2,' ')||Q'[,']' ||Rpad(bookname||Q'[']' ,20,' ')||Q'[,']' ||Rpad(publisher||Q'[']',12,' ')||Q'[,]' ||Lpad(price,6,' ')||Q'[);]' book from book; */ insert into BOOK values( 1,'Ã౸ÀÇ ¿ª»ç' ,'±Â½ºÆ÷Ã÷' , 7000); insert into BOOK values( 2,'Ã౸¾Æ´Â ¿©ÀÚ' ,'³ª¹«¼ö' , 13000); insert into BOOK values( 3,'Ã౸ÀÇ ÀÌÇØ' ,'´ëÇѹ̵ð¾î' , 22000); insert into BOOK values( 4,'°ñÇÁ ¹ÙÀ̺í' ,'´ëÇѹ̵ð¾î' , 35000); insert into BOOK values( 5,'ÇÇ°Ü ±³º»' ,'±Â½ºÆ÷Ã÷' , 8000); insert into BOOK values( 6,'¿ªµµ ´Ü°èº°±â¼ú' ,'±Â½ºÆ÷Ã÷' , 6000); insert into BOOK values( 7,'¾ß±¸ÀÇ Ãß¾ï' ,'ÀÌ»ó¹Ìµð¾î' , 20000); insert into BOOK values( 8,'¾ß±¸¸¦ ºÎŹÇØ' ,'ÀÌ»ó¹Ìµð¾î' , 13000); insert into BOOK values( 9,'¿Ã¸²ÇÈ À̾߱â' ,'»ï¼º´ç' , 7500); insert into BOOK values(10,'Olympic Champions' ,'Pearson' , 13000); commit; -------------- select * from ORDERS ; 10 row------------------ /* select 'insert into ORDERS values(' ||Lpad(orderid , 3,' ')||Q'[,]' ||Lpad(custid , 3,' ')||Q'[,]' ||Lpad(bookid , 3,' ')||Q'[,]' ||Lpad(saleprice, 6,' ')||Q'[,]' ||Rpad(Q'[ to_date(']'||orderdate||Q'[','yy/mm/dd')]',31,' ')||Q'[);]' ORDERS from ORDERS; */ insert into ORDERS values( 1, 1, 1, 6000, to_date('21/09/21','yy/mm/dd')); insert into ORDERS values( 2, 1, 3, 21000, to_date('21/11/23','yy/mm/dd')); insert into ORDERS values( 3, 2, 5, 8000, to_date('22/07/03','yy/mm/dd')); insert into ORDERS values( 4, 3, 6, 6000, to_date('22/07/04','yy/mm/dd')); insert into ORDERS values( 5, 4, 7, 20000, to_date('23/07/05','yy/mm/dd')); insert into ORDERS values( 6, 1, 2, 12000, to_date('23/07/07','yy/mm/dd')); insert into ORDERS values( 7, 4, 8, 13000, to_date('23/07/07','yy/mm/dd')); insert into ORDERS values( 8, 3, 10, 12000, to_date('24/12/28','yy/mm/dd')); insert into ORDERS values( 9, 2, 10, 7000, to_date('25/07/09','yy/mm/dd')); insert into ORDERS values( 10, 3, 8, 13000, to_date('21/04/10','yy/mm/dd')); commit; /* insert into ORDERS values( 1, 1, 1, 6000,'01-JUL-14'); insert into ORDERS values( 2, 1, 3, 21000,'03-JUL-14'); insert into ORDERS values( 3, 2, 5, 8000,'03-JUL-14'); insert into ORDERS values( 4, 3, 6, 6000,'04-JUL-14'); insert into ORDERS values( 5, 4, 7, 20000,'05-JUL-14'); insert into ORDERS values( 6, 1, 2, 12000,'07-JUL-14'); insert into ORDERS values( 7, 4, 8, 13000,'07-JUL-14'); insert into ORDERS values( 8, 3, 10, 12000,'08-JUL-14'); insert into ORDERS values( 9, 2, 10, 7000,'09-JUL-14'); insert into ORDERS values( 10, 3, 8, 13000,'10-JUL-14'); commit; */ --------------- select * from Imported_BOOK ; 2 row------------------------------- /* select Q'[insert into Imported_BOOK values(]' ||Lpad(bookid , 2,' ')||Q'[,']' ||Rpad(bookname||Q'[']' ,15,' ')||Q'[,']' ||Rpad(publisher||Q'[']',16,' ')||Q'[,]' ||Lpad(price,6,' ')||Q'[);]' Imported_BOOK from Imported_BOOK ; */ insert into Imported_BOOK values(21,'Zen Golf' ,'Pearson' , 12000); insert into Imported_BOOK values(22,'Soccer Skills' ,'Human Kinetics' , 15000); commit; select * from customer ; select * from book ; select * from orders ; select * from Imported_BOOK ;